<!DOCTYPE html>
<!--[if lt IE 7 ]>
<html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>
<html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>
<html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>
<html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"><!--<![endif]-->
<head>
    <title> 抽奖系统 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <!-- iphone safari -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="Author" contect="Mr.He"/>
    <link rel="apple-touch-icon" size="72x72" href="images/icon.png"/>
    <link rel="stylesheet" type="text/css" href="css/common.css">

    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #enterDiv input {
            height: 20px;
            width: 200px;;
        }
    </style>
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/jqm-1.1.1.min.js"></script>
    <script type="text/javascript">
        var nums = ["18391841072", "13335491198", "13474466567", "13572291895", "18729294476", "15991800907", "18729586729", "15291686020", "13194246424", "13060382898", "15929994492", "15129230678", "18192115707", "15353581635", "18009217360", "13619292636", "15829344555", "15040027080", "15691644828", "18991567551", "18729008466", "13787107012", "13152135930", "15209234051", "15840616012", "13098073088", "13467096923", "15991989228", "13572975836", "15891692523", "18691927202", "13384954137", "18909292610", "18802915000", "15229266101", "13914242428", "18829011866", "15389017858", "18609288792", "13991031596", "13319167041", "13488428702", "15191457745", "15001378088", "18681849485", "13888585519", "13110330309", "18009292704", "13519192323", "15957487640", "18991832938", "15667420113", "15040174528", "13992544383", "18909188827", "18992754618", "13571858183", "13335364445", "13689240662", "13002922406", "18792548186", "18049076441", "18309282823", "18355115112", "13259743876", "18710614970", "18109340000", "13572750874", "15353370333", "18691884204", "15891306259", "13408411141", "18809085613", "13720777662", "15191794509", "15129953368", "18092784995", "15829553134", "15191453552", "13324522542", "18066601193", "15991742441", "13572480681", "18503098529", "18182661919", "15229226520", "15809019776", "18629581001", "15841311268", "13689243454", "15099949520", "13809186680", "13991996479", "15929296234", "15686968970", "18163116116", "18629320717", "13104585775", "15293581667", "18643780020", "15353546090", "15356190792", "15802959242", "15667929633", "15984333751", "13484813924", "13576097217", "13636165952", "18993872722", "13891834402", "18017316308", "18966806361", "13840409653", "18681855071", "13264091199", "15898130117", "18629355222", "13572367041", "15618531550", "15929733413", "15229010141", "13399169989", "13098238153", "18909160245", "18691869816", "13379089162", "18629191035", "13571610290", "13923769989", "18691803561", "15332336768", "18049414853", "18629390926", "18681813794", "13720780713", "13991168756", "15802932634", "18991288788", "18510344343", "15967635789", "18049244997", "18700080229", "15896951850", "15146771155", "13964423593", "15129829344", "15094083409", "13084811915", "18078008150", "18697292028", "13110480502", "15388641561", "18679855246", "13891890434", "18991532123", "15866016089", "18191500020", "13649232224", "18629592972", "15389273687", "18577966446", "18680960018", "13478956156", "15091423270", "13664135424", "15009270815", "13575092486", "15802961380", "13679114530", "13992357722", "18873686084", "13572996840", "18074827615", "13299081801", "15829843432", "13379048981", "13649262177", "13488462226", "18591882354", "13892625116", "13572573341", "13925110725", "18734200631", "18979132177", "18502918988", "15109227680", "15388685344", "18699198021", "15802999976", "13460753210", "18658233009", "13992071727", "18609138313", "15120376404", "18674418887", "13992874116", "15191579518", "13032907828", "18091190959", "13609263847", "15114988218", "18591912506", "18702940309", "13572402022", "18602967539", "13186043009", "15680629538", "15002936943", "13571330978", "15291818944", "18192631686" ];
        var result = null;
        window.localStorage.setItem("numsIndex_z", 1);
        $(document).ready(function (e) {

            initnums();
            $(".backIndex").live("click", function () {
                window.location.href = "index.html";
            });
            $(".title").live("taphold", function () {
                $("#enterDiv").show();
            });
            $("#okbtn").live("click", function () {
                for(var i=1;i<=7;i++){
                    window.localStorage.setItem("num_z"+i,$("#z_number"+i).val());
                }
                $("#enterDiv").hide();
            });
            $("#cancelbtn").live("click", function () {
                $("#enterDiv").hide();
            });
            $("#refreshbtn").live("click", function () {
                initnums();
            });
            $(".wrap").css({"position": "relative", "top": "75%"});
            resize();
            $(".page img").live("click", function () {
                $(".numtitle").text("");
                if ($(this).attr("alt") == "off") {
                    drawstart();
                    $(this).attr({"alt": "on", "src": "images/stop.png"});
                } else {
                    stop();
                    $(this).attr({"alt": "off", "src": "images/start.png"});
                    var curIndex = localStorage.getItem("numsIndex_z") * 1;
                    $(".numtitle").text("第" + curIndex + "位幸运观众");
                    try{
                        shownum(localStorage.getItem("num_z"+curIndex));
                    }catch (e){

                    }finally{
                        curIndex++;
                        localStorage.setItem("numsIndex_z", curIndex);
                    }
                }
            });
            $(".title").live("click", function () {
                location.href = 'choujiang_g.html';
            })
        });
        function drawstart() {
            var l = nums.length;
            r = setInterval(function () {
                var randomIndex = Math.floor(Math.random() * l);
                shownum(nums[randomIndex]);
            }, 50);
        }
        function stop() {
            clearInterval(r);
        }
        function shownum(n) {
            n = n.substr(0, 3) +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    n.substr(7, 10);
            $(".numshow").html(n);
        }
        function resize() {
            var wH = $(window).height();
            $(".page").css({"height": wH + "px", "background-size": "100% " + wH + "px"});
        }
        window.onresize = resize;
        addEventListener("load", function hideURLbar() {
            window.scrollTo(0, 1);
        }, false);

        function initnums(){
            try{
                $.getJSON("http://vote2014z.xayoudao.com/index.php?r=Dsgd/get_award",function(result){
                    var datas=result.data,i=1;
                    $.each(datas,function(index,result){
                        $("#z_number"+(index+1)).val(datas[index]);
                    });
                });
                var nd=new Date();
                $("#nowdate").text(nd.getFullYear()+"年"+(nd.getMonth()+1)+"月"+nd.getDate()+"日"+nd.getHours()+":"+nd.getMinutes()+":"+nd.getMilliseconds());
            }catch (e){
                alert("网络问题,"+ e.message);
            }

        }
    </script>
    <style type="text/css">
        .page {
            padding: 0;
            background: url("images/backdraw.jpg") no-repeat;
            text-align: center
        }

        .wrap {
            width: 100%;
            height: 100px;
        }

        .wrap img {
            width: 40%;
        }
    </style>
</head>

<body>
<div id="enterDiv" style="display: none;">
    <div style="position: absolute;opacity: 0.5; background-color:#000;top: 0px;left: 0px;height: 100%;width: 100%;z-index: 888;"></div>
    <div style="position: absolute;background-color:#106DAC;top: 50px;left: 20%;padding-bottom: 50px;width: 60%;z-index: 999; color: #ffffff; font-size: 22px; border: 1px #fff solid;text-align: center">
        <br><br>
        专业组
        <br>
        <input type="number" class="inputnum_z" value="" id="z_number1"><br> <br>
        <input type="number" class="inputnum_z" value="13822222222" id="z_number2"><br> <br>
        <input type="number" class="inputnum_z" value="13833333333" id="z_number3"><br> <br>
        <input type="number" class="inputnum_z" value="13844444444" id="z_number4"><br> <br>
        <input type="number" class="inputnum_z" value="13555555555" id="z_number5"><br> <br>
        <input type="number" class="inputnum_z" value="13866666666" id="z_number6"><br> <br>
        <input type="number" class="inputnum_z" value="13877777777" id="z_number7"><br> <br>
        <span id="nowdate"></span>
        <br><br><br>
        <div style="width: 100%;height: 30px;text-align: center;">
            <a id="okbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">确定</a>&nbsp;&nbsp;&nbsp;
            <a id="cancelbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">取消</a>&nbsp;&nbsp;&nbsp;
            <a id="refreshbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">刷新</a>
        </div>
    </div>
</div>
<button class="backIndex"></button>
<button data-role="none" class="title">专业组抽奖</button>
<div class="numtitle"></div>
<div class="numshow">
    <table>
        <tr>
            <td></td>
        </tr>
    </table>
</div>
<div class="page">
    <div class="wrap">
        <img src="images/start.png" alt="off"/>
    </div>
</div>
</body>
</html>
